<!DOCTYPE html>
<!--引入模板引擎-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
<div id="wrap">
    <div id="left">
        <a href="javascript:void(0)" th:href="@{/updataUser}">新增</a>
        <form action="/students" method="post">
            姓名：<input type="text" name="name" th:value="${student.name}"><br>
            性别：<input type="radio" name="sex" value="男" th:checked="${student.sex} eq '男'">男
                  <input type="radio" name="sex" value="女" th:checked="${student.sex} eq '女'">女
                  <input type="radio" name="sex" value="" th:checked="${student.sex} eq '' ">全部<br>
            年级：<select name="gradeId" >
                    <option value="">全部</option>
                    <option value="1" th:selected="${student.gradeId}==1 ">S1</option>
                    <option value="2" th:selected="${student.gradeId}==2 ">S2</option>
                    <option value="3" th:selected="${student.gradeId}==3 ">Y2</option>
                  </select><br>
            <input type="submit" value="提交">
        </form>
        <table   class="table table-hover">
            <tr>
                <th>编号</th>
                <th>姓名</th>
                <th>性别</th>
                <th>年级编号</th>
                <th>操作</th>
            </tr>
            <!--  @{引用路径}  #{做国际化} ${取值} *{} -->
            <tr th:each="student:${pageInfo.getList()}">
                <td th:text="${student.id}"></td>
                <td th:text="${student.name}"></td>
                <td th:text="${student.sex}"></td>
                <td th:text="${student.gradeName}"> </td>
                <td>
                    <a href="javascript:void(0)" th:href="@{/dateUser/}+${student.id}">删除</a>
                    <a href="javascript:void(0)" th:href="@{/updataUser/(id=${student.id})}">修改</a>
                </td>
            </tr>
        </table>
        <p>当前 <span th:text="${pageInfo.pageNum}"></span> 页,总 <span th:text="${pageInfo.pages}"></span> 页,共 <span th:text="${pageInfo.total}"></span> 条记录</p>
        <a th:href="@{/students}">首页</a>
        <a th:href="@{/students(pageNum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}">上一页</a>
        <a th:href="@{/students(pageNum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}">下一页</a>
        <a th:href="@{/students(pageNum=${pageInfo.pages})}">尾页</a>

        <!--<a href="">首页</a>-->
        <!--<a href="">上一页</a>-->
        <!--<a href="">下一页</a>-->
        <!--<a href="">尾页</a>-->
        <!--总页数:5/当前页数:2-->
    </div>
</div>

<script src="" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">

</script>
</body>
</html>
